From: Jonas Dreßler Date: Mon, 6 Apr 2020 00:11:27 +0000 (+0200) Subject: st/theme-context: Also invalidate root node on stylesheet changes X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~684^2^2~528 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=bc973b80d77ba36e29fbeba27a2bed9e2ea6cf09;p=gnome-shell.git st/theme-context: Also invalidate root node on stylesheet changes Since commit 6a42d7726119c538d260e54cdbe2f31e5fbeb03c we invalidate the cached properties for each theme node on stylesheet changes by iterating over the hashtable of the theme context instead of listening to the signal in each individual theme node. That commit forgot one particular node though that's not stored in the hashtable, but using the `priv->root_node` property instead: The theme node that belongs to the stage. So make sure we also invalidate the cached properties of the stage theme node on stylesheet changes. This fixes various crashes that happened with extensions providing custom stylesheets (emitting the "custom-stylesheets-changed" signal on every extension enable/disable), trying to access an already freed CSS property of the stage. Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2584 --- diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c index de112aa49..bc0f89a4e 100644 --- a/src/st/st-theme-context.c +++ b/src/st/st-theme-context.c @@ -297,6 +297,9 @@ on_custom_stylesheets_changed (StTheme *theme, GHashTableIter iter; StThemeNode *node; + if (context->root_node) + _st_theme_node_reset_for_stylesheet_change (context->root_node); + g_hash_table_iter_init (&iter, context->nodes); while (g_hash_table_iter_next (&iter, (gpointer *) &node, NULL))